package com.newland.mesdk.demo.device;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by YJF on 2015/8/14 0014.
 */
public class BlueToothDeviceContext {
	public String name = "";
	public String address = "";
	private List<BlueToothDeviceContext> discoveredDevices = new ArrayList<BlueToothDeviceContext>();

	public BlueToothDeviceContext(String name, String address) {
		this.name = name;
		this.address = address;
	}

	/**
	 * 检查是蓝牙地址是否已经存在
	 * 
	 */
	public boolean ifAddressExist(String addr) {
		for (BlueToothDeviceContext devcie : discoveredDevices) {
			if (addr.equals(devcie.address))
				return true;
		}
		return false;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
}
